package kr.hkit.powerjava.chapter11.Programming;

public class Cylinder extends Circle {
	private double height;//높이

	public Cylinder() {//기본생성자
	}

	public Cylinder(double radius) {//반지름 받는 생성자
		super(radius);
	}

	public Cylinder(double radius, double height) {//반지름, 높이 생성자
		super(radius);
		this.height = height;
	}

	public double getHeight() {
		return height;
	}
	
	public double getVolume(){//부모클래스의 넓이를 이용해 부피 계산
		return super.getArea() * height;
	}

	@Override
	public String toString() {
		return String
				.format("Cylinder [Height()=%s, Volume()=%s, Radius()=%s, Area()=%s]",
						getHeight(), getVolume(), getRadius(), getArea());
	}
	
	
}
